{
  "name"    : "includer for portable testrunner",

  "include" : 
  [
    {
      "path" : "${QOOXDOO_PATH}/tool/data/config/base.json",
      "as"   : "base"
    }
  ],

  "config-warnings" :
  {
    "job-shadowing": [
      "source-script",
      "build",
      "build-script",
      "build-resources"
    ],
    
    "exclude" : [
      "testrunner.view.widget.*",
      "testrunner.TestLoader",
      "testrunner.TestLoaderInline",
      "testrunner.TestLoaderNative",
      "qx.dev.unit.TestLoaderInline"
    ]
  },
  
  "let" :
  {
    "APPLICATION"  : "testrunner",
    "ADD_NOCACHE_PARAM" : false,
    "QOOXDOO_PATH" : "../..",
    "API_EXCLUDE"  : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"],
    "LOCALES"      : [ "en" ],
    "CACHE"        : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache",
    "ROOT"         : ".",
    "BUILD_PATH"   : "build",
    "CACHE"        : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache",
    
    "TESTRUNNER_ROOT" : ".",
    "TESTRUNNER_ORIGIN" : "external",
    "TESTRUNNER_MAIN_CLASS" : "testrunner.Application",
    "TESTRUNNER_VIEW" : "testrunner.view.Html",
    "TESTRUNNER_SCRIPT" : "testrunner-portable.js",
    "BUILD_SCRIPT_FILE" : "${BUILD_PATH}/script/${TESTRUNNER_SCRIPT}"
  },
  
  "jobs" :
  {
    "portable-common" :
    {
      "environment" :
      {
        "qx.application"   : "${TESTRUNNER_MAIN_CLASS}",
        "qx.version"       : "${QOOXDOO_VERSION}",
        "qx.revision"      : "${QOOXDOO_REVISION}",
        "qx.allowUrlSettings" : true,
        "qx.testNameSpace" : "test",
        "testrunner.view" : "${TESTRUNNER_VIEW}",
        "testrunner.testOrigin" : "${TESTRUNNER_ORIGIN}",
        "testrunner.title" : "${APPLICATION}",
        "testrunner.testParts" : false,
        "testrunner.reportServer" : null,
        "testrunner.performance" : true
      },
      
      "library" :
      [
        {
          "manifest"   : "${QOOXDOO_PATH}/component/library/indigo/Manifest.json"
        },

        {
          "manifest" : "${QOOXDOO_PATH}/framework/Manifest.json"
        },

        {
          "manifest" : "${TESTRUNNER_ROOT}/Manifest.json"
        }
      ],
      
      "=include" :
      [
        "${TESTRUNNER_MAIN_CLASS}",
        "${TESTRUNNER_VIEW}"
      ],
      
      "exclude" :
      [
        "testrunner.view.widget.*",
        "testrunner.TestLoader",
        "testrunner.TestLoaderInline",
        "testrunner.TestLoaderNative",
        "qx.dev.unit.TestLoaderInline"
      ]
    },
    
    "source-script" :
    {
      "desc"    : "create a source loader (all classes as source files)",

      "extend" : [ "portable-common", "base::cache" ],
      
      "compile-options" :
      {
        "paths" :
        {
          "app-root" : "source",
          "file" : "source/script/${TESTRUNNER_SCRIPT}",
          "loader-template" : "${TESTRUNNER_ROOT}/tool/portable.loader.tmpl.js"
        },
        "uris" : 
        {
          "add-nocache-param" : "${ADD_NOCACHE_PARAM}"
        },
        "code" :
        {
          "locales" : "${LOCALES}",
          "code" : { "except" : [ "*" ] }
        }
      },

      "compile" : { "type" : "source" }
    },
    
    "build-script" :
    {
      "desc"    : "portable testrunner build script",
      "extend" : [ "portable-common", "base::cache" ],
      
      "environment" :
      {
        "qx.debug" : false,
        "qx.debug.databinding" : false,
        "qx.debug.dispose" : false
      },

      "compile-options" :
      {
        "paths" :
        {
          "file" : "${BUILD_SCRIPT_FILE}",
          "loader-template" : "${TESTRUNNER_ROOT}/tool/portable.loader.tmpl.js",
          "app-root" : "${BUILD_PATH}"
        },
        "uris"   :
        {
          "script"   : "script",
          "add-nocache-param" : false
        },
        "code" :
        {
          "format"   : true,
          "locales"  : "${LOCALES}",
          "except"   : [],
          "=optimize" : []
        }
      }, 

      "compile" : { "type" : "build" }
    },
    
    "gen-css" :
    {
      "extend" : ["base::cache"],

      "shell" :
      {
        "command" :
        [
          "${PYTHON_CMD} ${TESTRUNNER_ROOT}/tool/injectcss.py ${QOOXDOO_PATH}/component/library/indigo/source/resource/indigo/css/reset.css ${QOOXDOO_PATH}/component/library/indigo/source/resource/indigo/css/base.css ${TESTRUNNER_ROOT}/source/resource/testrunner/view/html/css/testrunner.css -t ${BUILD_SCRIPT_FILE} -q ${QOOXDOO_PATH}"
        ]
      }
    },
    
    "build-resources" :
    {
      "extend" : [ "portable-common", "base::build-resources" ]
    },
    
    "build" :
    {
      "=run" : [
        //"build-resources",
        "build-script",
        "gen-css"
      ]
    }
  }
}
